package com.xing.entity.vo;

import java.util.HashMap;
import java.util.Map;

public class AjaxMessage {
    private Boolean success;
    private int code;
    private String message;
    private final Map<String,Object> details =new HashMap<>();

    public Boolean getSuccess() {
        return success;
    }

    public AjaxMessage setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public int getCode() {
        return code;
    }

    public AjaxMessage setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public AjaxMessage setMessage(String message) {
        this.message = message;
        return this;
    }

    public Map<String, Object> getDetails() {
        return details;
    }

    public AjaxMessage addDetail(String key,Object value){
        details.put(key, value);
        return this;
    }

    public AjaxMessage addDetails(Map<String, Object> map){
        details.putAll(map);
        return this;
    }

}
